{% extends "common/base.nav.html" %}

{% block content %}
    <div class="container" style="width:95%">
        <div class="row">

            <!-- 侧边栏 -->
            <div class="col-md-2">
                {% if user.is_authenticated %}
                    <div class="panel-group" id="accordion">

                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h4 class="panel-title">
                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne"
                                       class="collapsed"><span
                                            class="glyphicon glyphicon-list-alt btn-xs"></span>博客管理</a>
                                </h4>
                            </div>
                            <div id="collapseOne" class="panel-collapse collapse
                            {% if '/' == request.path or 'blog' in request.path %} in
                             {% endif %}">
                                <div class="panel-body">
                                    <table class="table">
                                        <tbody>
                                        {% comment %}
                                        <tr>
                                            <td>
                                                <span class="glyphicon glyphicon-tree-conifer btn-xs"></span>
                                                <a href="{% url 'listgradeurl' %}">评分等级管理</a>
                                            </td>
                                        </tr>
                                        {% endcomment %}
                                        <tr>
                                            <td>
                                                <span class="glyphicon glyphicon-tree-conifer btn-xs"></span>
                                                <a href="{% url 'bloglisturl' %}">文章管理</a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h4 class="panel-title">
                                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" class="collapsed">
                                        <span class="glyphicon glyphicon-list-alt btn-xs"></span>用户管理</a>
                                </h4>
                            </div>
                            <div id="collapseTwo"
                                 class="panel-collapse collapse {% if 'accounts' in request.path %} in {% endif %}">
                                <div class="panel-body">
                                    <table class="table">
                                        <tbody>
                                        <tr>
                                            <td><span class="glyphicon glyphicon-tree-conifer btn-xs"></span>
                                                <a href={% url "listuserurl" %}>用户管理</a></td>
                                        </tr>
                                        <tr>
                                            <td><span class="glyphicon glyphicon-tree-conifer btn-xs"></span>
                                                <a href={% url "listroleurl" %}>角色管理</a></td>
                                        </tr>
                                        <tr>
                                            <td><span class="glyphicon glyphicon-tree-conifer btn-xs"></span>
                                                <a href={% url "listpermissionurl" %}>权限管理</a></td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                {% endif %}
            </div>

            <!-- 内容区域 -->
            <div class="col-md-10">
                {% block rcontent %}{% endblock %}
            </div>

        </div>
    </div>
{% endblock %}
